package lu.med.praxiswahl.wahlumed.client.cashbook;

import javax.swing.JPanel;

import java.awt.BorderLayout;
import java.awt.SystemColor;
import java.awt.Font;
import javax.swing.border.TitledBorder;
import java.awt.GridLayout;

import lu.med.praxiswahl.wahlumed.client.wclient.Main;

/**
 * 
 * @author Lars Holger Roth
 */

@SuppressWarnings("serial")
public class CashBookPanel extends JPanel {
	private Main dataManager;

	private CashBookTabbedPane tabbedPane;

	private ControlButtonPanel buttPanel;

	private MonthChooserPanel monthChooser;

	private TablePanel tablePanel;

	private ResultPanel resultPanel;

	public CashBookPanel(Main dataManager) {
		super();
		setBackground(SystemColor.window);
		this.setBounds(0, 0, 1284, 706);
		this.dataManager = dataManager;

		// this.tabbedPane = new CashBookTabbedPane(this.dataManager);
		// this.add(this.tabbedPane);

		this.tablePanel = new TablePanel("Test", this.dataManager);
		tablePanel.setBounds(0, 201, 1284, 379);
		tablePanel.setBackground(SystemColor.window);

		this.resultPanel = new ResultPanel();
		resultPanel.setBounds(0, 591, 1284, 104);
		resultPanel.getVerifyDateField().setBackground(SystemColor.window);
		resultPanel.getVerifyDateField().setFont(
				new Font("Verdana", Font.PLAIN, 11));
		resultPanel.getEndInventory().setBackground(SystemColor.window);
		resultPanel.getTotalSpending().setBackground(SystemColor.window);
		resultPanel.getTotalRevenue().setBackground(SystemColor.window);
		resultPanel.getInventoryBegin().setBackground(SystemColor.window);
		resultPanel.getEndInventory().setFont(
				new Font("Verdana", Font.PLAIN, 11));
		resultPanel.getTotalSpending().setFont(
				new Font("Verdana", Font.PLAIN, 11));
		resultPanel.getTotalRevenue().setFont(
				new Font("Verdana", Font.PLAIN, 11));
		resultPanel.getInventoryBegin().setFont(
				new Font("Verdana", Font.PLAIN, 11));
		resultPanel.getPeriodLab().setBounds(10, 11, 320, 20);
		resultPanel.getPeriodLab().setFont(new Font("Verdana", Font.BOLD, 11));
		resultPanel.setBackground(SystemColor.window);

		this.buttPanel = new ControlButtonPanel(this.tablePanel,
				this.resultPanel);
		buttPanel.setBounds(0, 0, 1284, 190);

		this.monthChooser = new MonthChooserPanel(this.tablePanel,
				this.resultPanel);

		this.buttPanel.addCashbookTypeListener(this.monthChooser);
		setLayout(null);

		buttPanel.setBorder(new TitledBorder(null, "Funktionsbereich",
				TitledBorder.LEADING, TitledBorder.TOP, null, null));

		this.add(this.buttPanel);
		// this.add(this.monthChooser);
		this.add(this.tablePanel);
		this.add(this.resultPanel);
	}
}
